#include <iostream>
#include "mgraph.cpp"

using namespace std;

Status print(VertexType v)
{
	cout << v << " ";
	return OK;
}

int main(void)
{
	MGraph graph(DG);;
	Status st;
	for(int i = 0; i <= 4; i++)
	{
		st = graph.InsertVex(i);
		if(st != OK)
			cout << "Error in inserting vertex." << endl;
	}
	for(int i = 0; i <= 3; i++)
	{
		graph.InsertArc(i, i+1);
		cout << "Insert arc:" << i << " " << i+1 << endl;
	}
	graph.InsertArc(0, 4);
	cout << "Insert arc:" << 0 << " " << 4 << endl;
	graph.InsertArc(4, 3);
	cout << "Deep-first traverse: ";
	graph.DFSTraverse(print);
	cout << endl;
	cout << "Breadth-first traverse: ";
	graph.BFSTraverse(print);
	cout << endl;
	return 0;
}
